package org.jeecg.modules.demo.com.kunpeng.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.com.kunpeng.service.IOaCustomerContactService;
import org.jeecg.modules.demo.com.kunpeng.vo.OaCustomerContactListByShareIdVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags="OA客户联系人表")
@RestController
@RequestMapping("/com.kunpeng/oaCustomerContact")
@Slf4j
public class OaCustomerContactController {

    @Autowired
    private IOaCustomerContactService oaCustomerContactService;

    /**
     * 根据客户id获取联系人列表
     * @param cid
     * @return
     */
    @ApiOperation(value="OA客户联系人表-根据客户联系人获取客户列表", notes="OA客户联系人表-根据客户联系人获取客户列表")
    @GetMapping(value = "/oaCustomerContactNameList")
    public Result<List<OaCustomerContactListByShareIdVO>> oaCustomerContactNameList(Integer cid){
        List<OaCustomerContactListByShareIdVO> oaCustomerContactListByShareIdVOS = oaCustomerContactService.OaCustomerContactListByCid(cid);
        return Result.ok(oaCustomerContactListByShareIdVOS);
    }
}
